load("//cargo:defs.bzl", "cargo_build_script")
load("//rust:defs.bzl", "rust_doc_test", "rust_library", "rust_test", "rust_test_suite")

cargo_build_script(
    name = "build_script",
    srcs = ["build.rs"],
    edition = "2018",
)

rust_library(
    name = "demo_lib",
    srcs = [
        "src/lib.rs",
    ],
    edition = "2018",
    deps = [":build_script"],
)

rust_test(
    name = "demo_lib_test",
    crate = ":demo_lib",
    edition = "2018",
)

rust_doc_test(
    name = "demo_lib_doc_test",
    crate = ":demo_lib",
)

rust_test_suite(
    name = "suite",
    srcs = glob(["tests/**"]),
    edition = "2018",
    deps = [":build_script"],
)
